//
//  CouponsViewController.m
//  Luxury
//
//  Created by DCQ on 2018/5/20.
//  Copyright © 2018年 ZNXZ. All rights reserved.
//

#import "CouponsViewController.h"
#import "CouponsListViewController.h"
#import "NewCouponsViewController.h"


@interface CouponsViewController ()

@end

@implementation CouponsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self setNavigationItemTitle: @"优惠券"];
    [self setupHeaderView];
    [self setupIndicator];
 
    
}


- (void)setupHeaderView{
    UIView * headerView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 70)];
    
    [self.view addSubview:headerView];
    UIImageView *imgV = [[UIImageView alloc]initWithFrame:headerView.frame];
    [headerView addSubview:imgV];
    imgV.userInteractionEnabled = YES;
    [imgV setImage:[UIImage imageNamed:@"youhuiuqna_banner"]];
    UITapGestureRecognizer *imgTap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapAction)];
    [imgV addGestureRecognizer:imgTap];
    
}
- (void)tapAction{
    NewCouponsViewController * newCouponsVC = [[NewCouponsViewController alloc]init];
    [self pushViewController:newCouponsVC];
    
}
- (void)setupIndicator{
    
    self.buttonBarView.shouldCellsFillAvailableWidth = YES;
    self.buttonBarView.backgroundColor = [UIColor whiteColor];
    self.isProgressiveIndicator = YES;
    self.isElasticIndicatorLimit = YES;
    //    self.buttonBarView.leftRightMargin = 10;
    //    self.buttonBarView.scrollsToTop = NO;
    //    self.buttonBarView.bounces = NO;
    // Do any additional setup after loading the view.
    
    self.buttonBarView.selectedBarAlignment = XLSelectedBarAlignmentCenter;
    self.buttonBarView.selectedBar.backgroundColor =  UIColorFromRGB(0xAD9B6A);
    self.buttonBarView.isAutoIndicatorWidth = NO;
    self.buttonBarView.indicatorWidth = 20;
    
    self.buttonBarView.backgroundColor = [UIColor whiteColor];
    self.bottomLineView.backgroundColor =  UIColorFromRGB(0xECEEEE);
    self.buttonBarView.bottomLineHeight = 1;
    
}
-(NSArray *)childViewControllersForPagerTabStripViewController:(XLPagerTabStripViewController *)pagerTabStripViewController{
    
    CouponsListViewController * oneVC = [[CouponsListViewController alloc]initWithStyle:TableViewControllerStyle_noUsed];
    CouponsListViewController * twoVC = [[CouponsListViewController alloc]initWithStyle:TableViewControllerStyle_used];
    CouponsListViewController * threeVC = [[CouponsListViewController alloc]initWithStyle:TableViewControllerStyle_overdue];
    NSArray * childViewControllers = [NSMutableArray arrayWithObjects:oneVC,twoVC,threeVC,nil];
    
    return childViewControllers;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (UIColor *)getTabTitleColorSelected{
    
    return UIColorFromRGB(0xAD9B6A);
}
- (UIColor *)getTabTitleColorNor{
    return  UIColorFromRGB(0x999999);
}
- (CGRect )buttonBarViewFrame{
    CGRect  buttonBarViewFrame = CGRectMake(0,70, self.view.frame.size.width, 44);
    return buttonBarViewFrame;
}
- (void)changeCurrentIndexUpdate:(NSInteger)toIndex{
    if (toIndex == 0) {
 
    }else if (toIndex == 1){
    
    }else if (toIndex == 2){
      
    }
    
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
